package com.lins.storedisk.entity.base;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
 * 对于常规实体只需要加上创建时间
 * 对于更详细的，可继承日志基础实体
 **/
@Data
@MappedSuperclass
public class BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@CreationTimestamp
	@Column(updatable = false,nullable = false) //name = "created_time"   columnDefinition = "DATE DEFAULT CURRENT_DATE"
	private java.sql.Timestamp createdTime;

	@UpdateTimestamp
	@Column(nullable = false)
	private java.sql.Timestamp updateTime;

}
